function Timer(idDiv) {
	var ms;
	var s;
	var m;
	var chrono;
	var divName;

	this.start = function(){
		this.ms++;
		if (this.ms>99){this.ms=0;this.s++}
		if (this.s>59){this.s=0;this.m++}
		this.attachToDiv();
		var scope = this;
		this.chrono=setTimeout(function(){scope.start();},10);
	}
	
	this.reset = function(){
		this.ms=0;
		this.s=0;
		this.m=0;
	}
	
	this.stop = function(){
		clearTimeout(this.chrono);
	}
	
	this.toString = function(){
		return this.m+":"+((this.s < 10)?"0"+this.s:this.s)+":"+((this.ms < 10)?"0"+this.ms:this.ms);
	}
	
	this.attachToDiv = function(){
		var div = document.getElementById(this.divName);
		div.innerHTML = this.toString();
	}
	
	this.ms=0;
	this.s=0;
	this.m=0;
	this.chrono;
	this.divName = idDiv;
}
